package responsibilitychain.source;

/**
 * @author Chen Guang
 * @date 2019/4/23 0023 上午 9:55
 */
public class Test {
    public static void main(String[] args) {
        Handler h1 = new ConcreteHandlerA();
        Handler h2 = new ConcreteHandlerB();
        Handler h3 = new ConcreteHandlerC();

        h1.setSuccessor(h2);
        h2.setSuccessor(h3);

        int[] requests = new int[]{2,3,5,14,22,18,27,20};

        for (int request : requests) {
            h1.handleRequest(request);
        }
    }
}
